package com.sskj.gocoin;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.alibaba.android.arouter.launcher.ARouter;
import com.flyco.dialog.utils.CornerUtils;
import com.flyco.dialog.widget.base.BaseDialog;
import com.sskj.lib.RConfig;

import butterknife.BindView;
import butterknife.ButterKnife;

public class NoLoginDialog extends BaseDialog<NoLoginDialog> {
    private TextView cancelTv;
    private TextView confirmTv;
    public NoLoginDialog(Context context) {
        super(context);
    }

    @Override
    public View onCreateView() {
        widthScale(0.9f);
        View conView = LayoutInflater.from(mContext).inflate(R.layout.dialog_no_login,null);
        cancelTv = conView.findViewById(R.id.tv_dialog_no_tip_cancel);
        confirmTv = conView.findViewById(R.id.tv_dialog_no_tip_confirm);
//        conView.setBackgroundDrawable(CornerUtils.cornerDrawable(Color.WHITE, dp2px(0f)));
//        conView.setBackground(CornerUtils.cornerDrawable(mContext.getResources().getColor(R.color.tabNormalColor),dp2px(5f)));
        return conView;
    }

    @Override
    public void setUiBeforShow() {
        cancelTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
        confirmTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ARouter.getInstance().build(RConfig.APP_LOGIN).navigation();
                dismiss();
            }
        });
    }

    @Override
    public void show() {
        super.show();
    }
}
